package chapter4.demo;

import linklisttest.Link;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @create 2018-03-16 下午4:32
 */
public class TestDemo {
    private static final Logger LOGGER = LoggerFactory.getLogger(TestDemo.class);

    public static void main(String[] args) {
        PetShop petShop = new PetShop();

        petShop.add(new Cat("波斯猫",1));
        petShop.add(new Cat("先罗猫",2));
        petShop.add(new Cat("波米拉猫",1));
        petShop.add(new Dog("金毛",1));
        petShop.add(new Dog("松狮",1));
        petShop.add(new Dog("波尔多",1));
        petShop.add(new Cat("奶牛猫",8));

        Link all = petShop.search("波");

        for (int i = 0; i < all.toArray().length; i++) {
            LOGGER.info(all.getNode(i).toString());
        }
    }
}
